<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src/components/Engine/Report/PieReportEngine.vue</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="..\..\..\..\prettify.css" />
    <link rel="stylesheet" href="..\..\..\..\base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(..\..\..\..\sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="..\..\..\..\index.html">All files</a> / <a href="index.html">src/components/Engine/Report</a> PieReportEngine.vue
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/37</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/20</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/21</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/37</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&lt;template&gt;
  &lt;div ref="content" :style="{width: source.data.width || '100%', height: source.data.height||'100px'}"&gt;&lt;/div&gt;
&lt;/template&gt;
&nbsp;
&lt;script&gt;
  // Pie设置教程
  // https://blog.csdn.net/sleepwalker_1992/article/details/82532210
  export default {
    name: 'PieReportEngine', /* 这个name暂时不知道用啥用，根据官方文档说的是方便排错的 */
<span class="fstat-no" title="function not covered" >    data() {</span>
<span class="cstat-no" title="statement not covered" >      return {</span>
        octopus: this.$parent.octopus,
        // 超过索引部分则循环从下标0开始。
        color: [
          "#F8B62D", // 橙黄色
          "#FF7600", // 橙色
          "#FF6200", // 橙红色
          "#FF6A6A", // 淡红色
          "#DB552D", // 体检报告红色
          "#EC342F", // 红色
          "#ACBED5", // 体检报告灰色
          "#BEE4F8", // 灰蓝色
          "#77EAFF", // 淡蓝色
          "#10B9F8", // 天蓝色
          "#008FFF", // 正蓝色
          "#0F49AA", // 深蓝色
          "#E4D354", // 黄色
          "#6A90D0", // 体检报告灰蓝色
          "#8085E9", // 淡紫色
          "#FDB747", // 体检报告黄色
          "#FFF7E5", // 体检报告米黄色
          "#B2DF8A", // 体检报告绿色
          "#90ED7D", // 绿色
          "#920783", // 紫色
        ]
      }
    },
<span class="fstat-no" title="function not covered" >    created: function () {</span>
<span class="cstat-no" title="statement not covered" >      this.init();</span>
<span class="cstat-no" title="statement not covered" >      let o = this;</span>
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >      setTimeout(function () {</span></span>
<span class="cstat-no" title="statement not covered" >        o.load();</span>
      }, 1000);
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("BarReportEngine执行了created事件。");</span>
    },
    // 只会执行一次
<span class="fstat-no" title="function not covered" >    mounted: function () {</span>
      // this.$nextTick(function () {
      //   this.octopus.tips.debug("BarReportEngine执行了$nextTick");
      // });
      // this.octopus.tips.debug("BarReportEngine执行了mounted事件。");
    },
<span class="fstat-no" title="function not covered" >    beforeUpdate: function () {</span>
      // this.octopus.tips.debug("BarReportEngine执行了beforeUpdate事件。");
    },
<span class="fstat-no" title="function not covered" >    updated: function () {</span>
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("[BarReportEngine执行了updated事件。");</span>
    },
    // 活动事件，写在这里的好处是不管是第一次创建还是后退回来，都会触发这个事件
    // 比较典型的就是列表组件，返回的时候往往是需要刷新的。
<span class="fstat-no" title="function not covered" >    activated: function () {</span>
      // this.load();
      // this.$nextTick(function () {
      //   this.octopus.tips.debug("BarReportEngine执行了activated.$nextTick事件。");
      // });
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("BarReportEngine执行了activated事件。");</span>
    },
    // 组件停用时，也就是切换出去的时候，需要注意的是，AppMenuEngine组件切换出去，不允许缓存，需要释放到初始状态，以便于下次进来。
<span class="fstat-no" title="function not covered" >    deactivated: function () {</span>
<span class="cstat-no" title="statement not covered" >      this.destroyData();</span>
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("BarReportEngine执行了deactivated事件。");</span>
    },
    computed: {
      // 如果cellData数据发生了改变,则触发这个事件。
<span class="fstat-no" title="function not covered" >      changeCell: function () {</span>
<span class="cstat-no" title="statement not covered" >        return this.source.id;</span>
      },
<span class="fstat-no" title="function not covered" >      changePage: function () {</span>
&nbsp;
      }
    },
    methods: {
<span class="fstat-no" title="function not covered" >      init: function () {</span>
<span class="cstat-no" title="statement not covered" >        this.initData();</span>
      },
      // 初始化数据，主要是还原#param等预设参数，重新绑定。
<span class="fstat-no" title="function not covered" >      initData: function () {</span>
        // 如果前端没有设置颜色
<span class="cstat-no" title="statement not covered" >        if (!this.source.report.colorData) {</span>
<span class="cstat-no" title="statement not covered" >          this.source.report.colorData = this.color;</span>
        }
        // alert("::" + JSON.stringify(this.source.report.colorData));
      },
      // 执行加载
<span class="fstat-no" title="function not covered" >      load: function () {</span>
<span class="cstat-no" title="statement not covered" >        let o = this;</span>
&nbsp;
        // 基于准备好的dom，初始化echarts实例
<span class="cstat-no" title="statement not covered" >        let reportContent = this.octopus.vue.$echarts.init(this.$refs.content);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >        this.octopus.request.api.post("/Octopus/Engine/List", this.source.data,</span>
          // 处理回调事件，通过分析data.status.code的状态来实现。
<span class="fstat-no" title="function not covered" >          function (data) {</span>
<span class="cstat-no" title="statement not covered" >            if (data.status.code == 200) {</span>
              // 渲染图表数据
<span class="cstat-no" title="statement not covered" >              let optionData = {</span>
                // backgroundColor: 'pink',
                // title: {
                //   text: o.source.report.title.name || "",
                //   subtext: o.source.report.title.note || "",
                //   x: o.source.report.title.local || "left",
                //   // top: 20, // 下沉20
                // },
                tooltip: {
                  trigger: 'item',
                  axisPointer: {
                    type: 'cross',
                    crossStyle: {
                      color: '#00ff00'
                    },
                  },
                  // 展示面板格式化
<span class="fstat-no" title="function not covered" >                  formatter: function (params) {</span>
<span class="cstat-no" title="statement not covered" >                    let res = params.name + "：" + params.percent + "%（" + params.value + "）";</span>
<span class="cstat-no" title="statement not covered" >                    return res;</span>
                  },
                },
                toolbox: {
                  right: "20",
                  feature: {
                    // restore: {show: true},
                    saveAsImage: {show: true}
                  }
                },
                legend: {
                  // right: 10, // 各项偏移设置
                  // top: 20,
                  bottom: 10,
                  // data: ['用电量', '预算电量', '功率', '预算功率']
                  // selected: {'用电量': false, '预算用电量': false}      // 后续可控制初始化显示或隐藏的列
                },
                series: [{
                  type: 'pie',
                  radius: '75%',
                  center: ['50%', '50%'],
                  selectedMode: 'single', // 点击展开效果
                  data: [
                    // {value: 1548, name: '幽州', itemStyle: {normal: {color: '#DB552D'}}},
                    // {value: 235, name: '荆州', itemStyle: {normal: {color: '#6A90D0'}}},
                    // {value: 510, name: '兖州', itemStyle: {normal: {color: '#204771'}}},
                    // {value: 634, name: '益州', itemStyle: {normal: {color: '#FDB747'}}},
                    // {value: 735, name: '西凉', itemStyle: {normal: {color: '#238FF1'}}}
                  ],
                  label: {                  //饼图图形上的文本标签
                    normal: {
                      show: true,
                      // position: 'inner', //标签的位置
                      textStyle: {
                        fontWeight: 300,
                        fontSize: 12        //文字的字体大小
                      },
<span class="fstat-no" title="function not covered" >                      formatter: function (params) {</span>
                        // let res = params.name + "\n" + params.percent + "%";
<span class="cstat-no" title="statement not covered" >                        let res = params.percent + "%";</span>
<span class="cstat-no" title="statement not covered" >                        return res;</span>
                      },
                    }
                  },
                }]
              };
&nbsp;
<span class="cstat-no" title="statement not covered" >              if (o.source.report.title) {</span>
<span class="cstat-no" title="statement not covered" >                optionData.title = {</span>
                  text: o.source.report.title.name || "",
                  subtext: o.source.report.title.note || "",
                  x: o.source.report.title.local || "left",
                  // top: 20, // 下沉20
                };
              }
&nbsp;
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >              $(data.content.queryData).each(function (index, item) {</span></span>
<span class="cstat-no" title="statement not covered" >                if (item[o.source.report.cellData.item] != null &amp;&amp; item[o.source.report.cellData.value] != null) {</span>
                  // 拼装series数据
<span class="cstat-no" title="statement not covered" >                  let seriesData = {</span>
                    value: item[o.source.report.cellData.value],
                    name: item[o.source.report.cellData.item],
                    itemStyle: {
                      normal: {
                        color: o.color[index] || o.color.DarkGrey,
                      }
                    }
                  };
<span class="cstat-no" title="statement not covered" >                  optionData.series[0].data.push(seriesData);</span>
                } else {
<span class="cstat-no" title="statement not covered" >                  o.octopus.tips.error("项目列不存在，请检查配置。");</span>
                }
              });
&nbsp;
              // 执行渲染
<span class="cstat-no" title="statement not covered" >              reportContent.setOption(optionData);</span>
              // 执行事件
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >              reportContent.on('click', function (params) {</span></span>
<span class="cstat-no" title="statement not covered" >                if (o.clicked) {</span>
<span class="cstat-no" title="statement not covered" >                  o.clicked({</span>
                    title: params.seriesName,
                    name: params.name,
                    value: params.value,
                    type: params.seriesType,
                  });
                }
              });
            } else {
<span class="cstat-no" title="statement not covered" >              o.octopus.tips.error(data);</span>
            }
          });
&nbsp;
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >        $(window).resize(function () {</span></span>
<span class="cstat-no" title="statement not covered" >          reportContent.resize();</span>
        });
      },
      // 组件停用时把data修正回原始数据，其他属性因为不会变，所以不用还原。
<span class="fstat-no" title="function not covered" >      destroyData: function () {</span>
&nbsp;
      },
      // 控件数据变更事件
<span class="fstat-no" title="function not covered" >      change: function (new_cell, old_cell) {</span>
&nbsp;
      },
    },
    watch: {},
    props: ["source", "changed", "clicked"]
  }
&nbsp;
&lt;/script&gt;
&nbsp;
/*  scoped的意思是这里的样式只对当前页面有效不会影响其他页面，还有可以设置lang="scss"就是支持css预编译，也就是支持sass或者less  */
&lt;!-- Add "scoped" attribute to limit CSS to this component only --&gt;
&lt;style scoped&gt;
  h1, h2 {
    font-weight: normal;
  }
&nbsp;
&lt;/style&gt;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Jan 20 2020 17:54:15 GMT+0800 (GMT+08:00)
</div>
</div>
<script src="..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="..\..\..\..\sorter.js"></script>
</body>
</html>
